﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace SF.Base.Core {
	public class AdviseRules {
		/// <summary>
		/// 提交意见和建议
		/// </summary>
		/// <param name="userid"></param>
		/// <param name="advise"></param>
		/// <returns></returns>
		public static int Advise(string userId, string advise) {

			IDataParameter[] ids = {
				Sh.GetParameter("@Advise",DbType.String,advise),
                Sh.GetParameter("@user_id",DbType.String,userId)
            };

			try {
				int ret = Sh.ExecuteNonQuery(
					BaseSettings.Instance.ConnSF,
					CommandType.Text,
					@"
						insert into dt_advise (
							user_id,Advise,Status
						) 
						values (
							@user_id,@Advise,0
						);
					",
					ids
				);
				return 0;
			}
			catch (System.Exception e) {
				Logger.Exception("提交意见和建议失败", e);
				return -160701;
			}
		}
	}
}
